package com.jctrip.hotel.source.mq;

import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.client.producer.DefaultMQProducer;
import org.apache.rocketmq.client.producer.SendCallback;
import org.apache.rocketmq.client.producer.SendResult;
import org.apache.rocketmq.common.message.Message;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @Author: zxy
 * @CreateTime: 2023-12-18 14:10
 * @Description:
 */
@Slf4j
@Component
public class HotelCallbackDefaultMqProducer {

//    @Resource(name = "hotelCallbackDefaultMQProducer")
//    private DefaultMQProducer hotelCallbackDefaultMQProducer;

    public void send(String msg) {
//        Message message = new Message("hworldCallbackHotelIds", "", msg.getBytes());
        try {
//            hotelCallbackDefaultMQProducer.send(message, new SendCallback() {
//                @Override
//                public void onSuccess(SendResult sendResult) {
//                }
//
//                @Override
//                public void onException(Throwable throwable) {
//                    log.error("send log callback error!", throwable);
//                }
//            });
        } catch (Exception e) {
            log.error("send log error!", e);
        }
    }
}
